<template>
    <div class="main_content record">
        <div class="scorll">
            <div class="content">
                <div class="search">
                    <Tabs v-model="tabActiveName"  @on-click="setTabClick">
                        <TabPane :label="`待处理（${isCount>99?'99+':isCount}）`" name="0"></TabPane>
                        <TabPane :label="`已处理（${count>99?'99+':count}）`" name="1"></TabPane>
                    </Tabs>
                </div>
                <div class="search" style="margin-top: 20px;">
                    <div class="list">
                        <span>报警类型:</span>
                        <Select v-model="fseRuleType" style="width:200px;" placeholder="请选择报警类型">
                            <Option v-for="item in ruleTypeList" :value="item.ruleId" :key="item.ruleId">{{item.name}}</Option>
                        </Select>
                        <input type="password" autocomplete="new-password" style="display: none" />
                    </div>
                    <div class="list">
                        <span>开始时间:</span>
                        <DatePicker type="datetime" :options="options" placeholder="请选择开始时间" style="width: 200px" format="yyyy-MM-dd" @on-change="getStartTime" v-model="startTime" :clearable="false"></DatePicker>
                    </div>
                    <div class="list">
                        <span>结束时间:</span>
                        <DatePicker :options="options" type="datetime" placeholder="请选择结束时间" style="width: 200px" format="yyyy-MM-dd" @on-change="getEndTime" v-model="endTime" :clearable="false"></DatePicker>
                    </div>
                    <div class="list">
                        <el-button type="primary" @click="searchAll" size="small" plain>搜索</el-button>
                        <el-button type="info" @click="clear" style="margin-left:20px;" size="small" plain>重置</el-button>
                        <el-button type="primary" size="small"  plain style="margin-left:20px" v-if="handleType" :disabled="warnIdList.length == 0 || !btnList.includes('fse/crane/warnRecord/batch')" @click="allhandle">批量处理</el-button>
                    </div>
                </div>
                <div class="table">
                    <el-table :data="list" style="width: 100%" :stripe='true' @row-click="getHandleDetails" @selection-change="handleSelectionChange">
                        <el-table-column type="selection" width="55" > </el-table-column>
                        <el-table-column fixed="left" prop="triggerTime" label="报警时间" width="200px"></el-table-column>
                        <el-table-column prop="code" label="报警设备"></el-table-column>
                        <el-table-column prop="type" label="设备类型">
                            <template slot-scope="scope">
                                <span v-if="scope.row.type == 1">塔机</span>
                                <span v-if="scope.row.type == 2">升降机</span>
                                <span v-if="scope.row.type == 3">龙门吊</span>
                                <span v-if="scope.row.type == 4">架桥机</span>
                                <span v-if="scope.row.type == 5">履带吊</span>
                            </template>
                        </el-table-column>
                        <el-table-column prop="ruleType" label="报警类型">
                            <template slot-scope="scope">
                                {{scope.row.ruleType | getTitle(ruleTypeList)}}
                            </template>
                        </el-table-column>
                        <el-table-column label="报警详情" :show-overflow-tooltip="true" width="300px" >
                            <template slot-scope="scope">
                                <span v-if="scope.row.ruleType == 101">暂无</span>
                                <span v-else-if="scope.row.ruleType == 102">起重量数值{{ scope.row.triggerValue }}t</span>
                                <span v-else-if="scope.row.ruleType == 103">力矩数值{{ scope.row.triggerValue }}N.m</span>
                                <span v-else-if="scope.row.ruleType == 104">幅度数值{{ scope.row.triggerValue }}m</span>
                                <span v-else-if="scope.row.ruleType == 105">幅度数值{{ scope.row.triggerValue }}m</span>
                                <span v-else-if="scope.row.ruleType == 106">高度数值{{ scope.row.triggerValue }}m</span>
                                <span v-else-if="scope.row.ruleType == 107">左回转数值{{ scope.row.triggerValue }}°</span>
                                <span v-else-if="scope.row.ruleType == 108">右回转数值{{ scope.row.triggerValue }}°</span>
                                <span v-else-if="scope.row.ruleType == 109">风速数值{{ scope.row.triggerValue }}m/s</span>
                                <span v-else-if="scope.row.ruleType == 110">倾角数值{{ scope.row.triggerValue }}°</span>
                                <span v-else-if="scope.row.ruleType == 201">高度数值{{ scope.row.triggerValue }}m</span>
                                <span v-else-if="scope.row.ruleType == 202">重量数值{{ scope.row.triggerValue }}t</span>
                                <span v-else-if="scope.row.ruleType == 203">运行速度数值{{ scope.row.triggerValue }}m/s</span>
                                <span v-else-if="scope.row.ruleType == 204">前门未关</span>
                                <span v-else-if="scope.row.ruleType == 205">后门未关</span>
                                <span v-else-if="scope.row.ruleType == 206">风速数值{{ scope.row.triggerValue }}m/s</span>
                                <span v-else-if="scope.row.ruleType == 207">倾角数值{{ scope.row.triggerValue }}°</span>
                                <span v-else-if="scope.row.ruleType == 208">人数{{ scope.row.triggerValue }}</span>
                                <span v-else-if="scope.row.ruleType == 501">回转角度{{ scope.row.triggerValue }}°</span>
                                <span v-else-if="scope.row.ruleType == 502">高度数值{{scope.row.triggerValue}}m</span>
                                <span v-else-if="scope.row.ruleType == 503">重量数值{{scope.row.triggerValue}}t</span>
                                <span v-else-if="scope.row.ruleType == 504">高度数值{{scope.row.triggerValue}}m</span>
                                <span v-else-if="scope.row.ruleType == 505">重量数值{{scope.row.triggerValue}}t</span>
                                <span v-else-if="scope.row.ruleType == 506">防后倾数值{{scope.row.triggerValue}}°</span>
                                <span v-else-if="scope.row.ruleType == 507">风速数值{{ scope.row.triggerValue }}m/s</span>
                                <p v-else-if="scope.row.ruleType == 509" style="width: 300px;overflow:hidden;text-overflow: ellipsis;white-space: nowrap;cursor:pointer;">
                                    <span v-for="(item , index) in JSON.parse(scope.row.triggerValue || '[]')" :key="index">探头感应距离{{index +1}}    {{item || 0}}米</span><br>
                                </p>
                                <span v-else>{{scope.row.triggerValue}}</span>
                            </template>
                        </el-table-column>
                        <el-table-column prop="handleTime" label="处理时间" v-if="state == 1" width="200px"></el-table-column>
                        <el-table-column prop="handleUserName" label="处理人" v-if="state == 1"></el-table-column>
                        <el-table-column fixed="right" label="操作" width="120px" align="center">
                            <template slot-scope="scope">
                                <el-button v-if="state == 1" @click.native.prevent="handle(scope.$index, list)" type="text" size="small" v-preventReClick="1500">查看详情</el-button>
                                <el-button v-if="state == 0" @click.native.prevent="handle(scope.$index, list)" :disabled="!btnList.includes('fse/crane/warnRecord/deal')" type="text" size="small" v-preventReClick="1500">处理</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
                <div class="clearfix"  >
                    <div class="float-right">
                        <Page v-if="totalCount" style="margin: 20px 0;text-align: center;" :current.sync="current" :total="totalCount" :page-size="pageSize" show-elevator show-total @on-change="pageChange"></Page>
                    </div>
                </div>
            </div>
        </div>
        <Modal v-model="handleModal" width="800px" :mask-closable="false" :title="isAdd ? '报警信息处理' : '报警信息详情'">
            <div class="msg">
                <div class="handle-details">
                    <div class="title2">设备信息</div>
                    <div class="title3">
                        设备类型:
                        <span v-if="type == 1">塔机/{{ modelName }}</span>
                        <span v-if="type == 2">升降机/{{ modelName }}</span>
                        <span v-if="type == 3">龙门吊/{{ modelName }}</span>
                        <span v-if="type == 4">架桥机/{{ modelName }}</span>
                        <span v-if="type == 5">履带吊/{{ modelName }}</span>
                    </div>
                    <div class="title3">
                        设备编号:
                        <span>{{ code }}</span>
                    </div>
                    <div class="title3">
                        操作手:
                        <span v-for="(val, i) in operatorList" :key="i">{{ val.name }}/{{ val.phone }}</span>
                    </div>
                </div>
                <div class="handle-details">
                    <div class="title2">报警详情</div>
                    <div class="title3">
                        报警类型:
                        <span v-if="ruleType == 101">塔机防碰撞报警</span>
                        <span v-if="ruleType == 102">塔机起重量报警</span>
                        <span v-if="ruleType == 103">塔机力矩报警</span>
                        <span v-if="ruleType == 104">塔机最大幅度报警</span>
                        <span v-if="ruleType == 105">塔机最小幅度报警</span>
                        <span v-if="ruleType == 106">塔机高度上限报警</span>
                        <span v-if="ruleType == 107">塔机回转左限位报警</span>
                        <span v-if="ruleType == 108">塔机回转右限位报警</span>
                        <span v-if="ruleType == 109">塔机风速报警</span>
                        <span v-if="ruleType == 110">塔机倾角报警</span>
                        <span v-if="ruleType == 201">升降机重量报警</span>
                        <span v-if="ruleType == 202">升降机重量报警</span>
                        <span v-if="ruleType == 203">升降机运行速度报警</span>
                        <span v-if="ruleType == 204">升降机前门未关报警</span>
                        <span v-if="ruleType == 205">龙门吊主起升超载报警</span>
                        <span v-if="ruleType == 206">龙门吊副起升超载报警</span>
                        <span v-if="ruleType == 207">龙门吊风速报警</span>
                        <span v-if="ruleType == 208">架桥机前天车超载报警</span>
                        <span v-if="ruleType == 209">架桥机后天车超载报警</span>
                        <span v-if="ruleType == 210">架桥机风速报警</span>
                        <span v-if="ruleType == 501">履带吊回转报警</span>
                        <span v-if="ruleType == 502">履带吊主钩高度报警</span>
                        <span v-if="ruleType == 503">履带吊主钩重量报警</span>
                        <span v-if="ruleType == 504">履带吊副钩高度报警</span>
                        <span v-if="ruleType == 505">履带吊副钩重量报警</span>
                        <span v-if="ruleType == 506">履带吊防后倾报警</span>
                        <span v-if="ruleType == 507">履带吊风速报警</span>
                        <span v-if="ruleType == 508">履带吊非正常操作报警</span>
                        <span v-if="ruleType == 509">防碰撞</span>
                    </div>
                </div>
                <div class="handle-details">
                    <div class="title2">报警信息</div>
                    <div class="title3">
                        报警时间:
                        <span>{{ triggerTime }}</span>
                    </div>
                    <div class="title3" style="display: flex;justify-content: flex-start;align-items: flex-start;">
                        报警详情:
                        <span v-if="ruleType == 101">暂无</span>
                        <span v-if="ruleType == 102">起重量数值{{ triggerValue }}t</span>
                        <span v-if="ruleType == 103">力矩数值{{ triggerValue }}N.m</span>
                        <span v-if="ruleType == 104">幅度数值{{ triggerValue }}m</span>
                        <span v-if="ruleType == 105">幅度数值{{ triggerValue }}m</span>
                        <span v-if="ruleType == 106">高度数值{{ triggerValue }}m</span>
                        <span v-if="ruleType == 107">左回转数值{{ triggerValue }}°</span>
                        <span v-if="ruleType == 108">右回转数值{{ triggerValue }}°</span>
                        <span v-if="ruleType == 109">风速数值{{ triggerValue }}m/s</span>
                        <span v-if="ruleType == 110">倾角数值{{ triggerValue }}°</span>
                        <span v-if="ruleType == 201">重量数值{{ triggerValue }}t</span>
                        <span v-if="ruleType == 202">重量数值{{ triggerValue }}t</span>
                        <span v-if="ruleType == 203">运行速度数值{{ triggerValue }}m/s</span>
                        <span v-if="ruleType == 204">前门未关</span>
                        <span v-if="ruleType == 205">主起升重量数值{{ triggerValue }}t</span>
                        <span v-if="ruleType == 206">副起升重量数值{{ triggerValue }}t</span>
                        <span v-if="ruleType == 207">风速数值{{ triggerValue }}m/s</span>
                        <span v-if="ruleType == 208">前天车重量数值{{ triggerValue }}t</span>
                        <span v-if="ruleType == 209">后天车重量数值{{ triggerValue }}t</span>
                        <span v-if="ruleType == 210">风速数值{{ triggerValue }}m/s</span>
                        <span v-if="ruleType == 501">回转角度{{triggerValue}}°，回转速度{{triggerValue}}°/s</span>
                        <span v-if="ruleType == 502">高度数值{{triggerValue}}m</span>
                        <span v-if="ruleType == 503">重量数值{{triggerValue}}t</span>
                        <span v-if="ruleType == 504">高度数值{{triggerValue}}m</span>
                        <span v-if="ruleType == 505">重量数值{{triggerValue}}t</span>
                        <span v-if="ruleType == 506">防后倾数值{{triggerValue}}°</span>
                        <span v-if="ruleType == 507">风速数值{{ triggerValue }}m/s</span>
                        <span v-if="ruleType == 508">非正常操作数值{{triggerValue}}</span>
                        <div>
                            <div v-if="ruleType == 509">
                                <div style="font-weight: normal" v-for="(item , index) in JSON.parse(triggerValue || '[]')" :key="index">探头感应距离{{index +1}}    {{item || 0}}米</div> <br>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="handle-details">
                    <div class="title2">报警处理</div>
                    <div class="title3" v-if="!isAdd">
                        处理人:
                        <span>{{handleUserName}}</span>
                    </div>
                    <div class="title3" v-if="!isAdd">
                        处理时间:
                        <span>{{handleTime }}</span>
                    </div>
                    <div class="title3"><span class="tip" style="color:red" v-if="isAdd">*</span>报警原因</div>
                    <div class="list">
                        <div class="item" style="width:100%;align-items: center">
                            <el-input v-model="handleRemark" type="textarea" placeholder="请输入内容" maxlength="100" show-word-limit style="width: 600px;margin: 0 auto;font-size:14px" :disabled="!isAdd"></el-input>
                        </div>
                    </div>
                    <div class="title3"><span class="tip" style="color:red" v-if="isAdd">*</span>处理结果</div>
                    <div class="list">
                        <div class="item" style="width:100%;align-items: center">
                            <el-input v-model="handleResult" type="textarea" placeholder="请输入内容" maxlength="100" show-word-limit style="width: 600px;margin: 0 auto;font-size:14px" :disabled="!isAdd"></el-input>
                        </div>
                    </div>
                </div>
            </div>
            <div slot="footer">
                <el-button @click="cancel(0)" v-if="isAdd" type="info" size="small" plain>取消</el-button>
                <el-button @click="ok(0)" type="primary" v-if="isAdd" size="small" plain>确定</el-button>
            </div>
        </Modal>
        <Modal v-model="Modal" title="报警信息处理" width="360px;" :mask-closable="false">
            <p style="width:100%;text-align:center;color:red;">
                处理消息一旦确认，就无法更改！
            </p>
            <div style="width:100%;text-align:center;font-size:16px;color:red;">
                您是否确认处理结果？
            </div>
            <div slot="footer">
                <el-button @click="cancel(1)" type="info" size="small" plain>取消</el-button>
                <el-button @click="submit" type="primary" size="small" plain v-preventReClick="1500">确定</el-button>
            </div>
        </Modal>
        <Modal v-model="allhandleModal" width="800px" :mask-closable="false" title="批量处理">
            <div class="msg">
                <div class="handle-details">
                    <div class="title2">报警处理</div>
                    <div class="title3"><span class="tip" style="color: red">*</span>报警原因</div>
                    <div class="list">
                        <div class="item" style="width:100%;align-items: center">
                            <el-input v-model="allhandleRemark" type="textarea" placeholder="请输入内容" maxlength="100" show-word-limit style="width: 600px;margin: 0 auto;font-size:14px" ></el-input>
                        </div>
                    </div>
                    <div class="title3"><span class="tip" >*</span>处理结果</div>
                    <div class="list">
                        <div class="item" style="width:100%;align-items: center">
                            <el-input v-model="allhandleResult" type="textarea" placeholder="请输入内容" maxlength="100" show-word-limit style="width: 600px;margin: 0 auto;font-size:14px" ></el-input>
                        </div>
                    </div>
                </div>
            </div>
            <div slot="footer">
                <el-button @click="cancel(3)"  type="info" size="small" plain>取消</el-button>
                <el-button @click="ok(1)" type="primary"  size="small" plain>确定</el-button>
            </div>
        </Modal>
    </div>
</template>

<script>
import {
    getFseRecordList,
    getFseRecordHandle,
    getFseRecordDetails,
    getFseRecordBatchHandle,
    getFseRuleList
} from "@/api/api.js";
import {initYMD} from "@/sever/utils";
export default {
    name:"warnRecord",
    props:{
        recordType:{
            type: Number,
            default: ''
        }
    },
    data() {
        return {
            tabActiveName:'0',
            options: {
                disabledDate(date) {
                    return date > Date.now();
                }
            },
            current: 1,
            pageSize: 10,
            pageNum: 1,
            totalCount: 0,
            list: [],
            flag: true,
            state: 0,
            handleModal: false,
            isAdd: false,
            Modal: false,
            count: 0,
            isCount: 0,
            porjectType: "",
            // 详情参数
            type: "",
            modelName: "",
            code: "",
            operatorList: [],
            ruleType: "",
            ruleMinValue: "",
            triggerTime: "",
            triggerValue: "",
            handleTime: "",
            handleResult: "",
            handleRemark: "",
            handleUserName: "",
            warnId: "",
            ruleTypeList: [],
            fseRuleType: "",
            startTime: "",
            endTime: "",
            handleFlag:false,
            handleType:true,
            warnIdList:[],
            allhandleModal:false,
            allhandleRemark:"",
            allhandleResult:"",
            btnList:''
        };
    },
    computed: {
        porjectObject() {
            return this.$store.state.porjectObject;
        }
    },
    watch: {
        porjectObject(val, oldVal) {
            if (val.deptId != oldVal.deptId) {
                this.porjectType = val.deptId;
                this.fseRuleType = "";
                this.pageNum = 1;
                this.current = 1;
                this.startTime = "";
                this.endTime = "";
                this.getAllList();
                this.initData();
                this.getruleTypeList();
            }
        }
    },
    filters:{
        getTitle(type,list){
            let obj = list.find((item)=>{
                return item.ruleType==type
            })
            return obj.name || ""
        }
    },
    mounted() {
        this.porjectType = this.$store.state.porjectObject.deptId;
        this.btnList = JSON.parse(localStorage.getItem("arr"));
        this.getAllList();
        this.initData();
        this.getruleTypeList();
    },
    methods: {
        getruleTypeList(){
            this.ruleTypeList = [];
            let parmas = {
                deptId: this.porjectType,
                type: this.recordType,
            };
            getFseRuleList(parmas).then(res => {
                if (res.code == 200) {
                    this.ruleTypeList = res.data.list;
                } else {
                    this.$Message.warning(res.msg);
                }
            })
            .catch(error => {
                console.log(error);
            });
        },
        initData(){
            this.getIsCountFn();
            this.getCountFn();
        },
        //获取待整改
        getIsCountFn() {
            let parmas = {
                deptId: this.porjectType,
                state: 0,
                ruleType: this.fseRuleType,
                pageNum: this.pageNum,
                pageSize: this.pageSize,
                startDate: this.startTime ? initYMD(this.startTime) :'',
                endDate: this.endTime ? initYMD(this.endTime) :'',
                type:this.recordType
            };
            getFseRecordList(parmas)
                .then(res => {
                    if (res.code == 200) {
                        this.isCount = res.data.total;
                        if(this.state == 0 ){
                            this.totalCount = res.data.total;
                        }
                    } else {
                        this.$Message.warning(res.msg);
                    }
                })
                .catch(error => {
                    console.log(error);
                });
        },
        //获取已整改
        getCountFn() {
            let parmas = {
                deptId: this.porjectType,
                state: 1,
                ruleType: this.fseRuleType,
                pageNum: this.pageNum,
                pageSize: this.pageSize,
                startDate: this.startTime ? initYMD(this.startTime) :'',
                endDate: this.endTime ? initYMD(this.endTime) :'',
                type:this.recordType,
            };
            getFseRecordList(parmas)
                .then(res => {
                    if (res.code == 200) {
                        this.count = res.data.total;
                        if(this.state == 1 ){
                            this.totalCount = res.data.total;
                        }
                    } else {
                        this.$Message.warning(res.msg);
                    }
                })
                .catch(error => {
                    console.log(error);
                });
        },
        setTabClick(name) {
            if (name==='0') {
               this.gethandle()
               this.handleType = true;
            } else if (name==="1"){
                this.getYhandle();
                this.handleType = false;
            }
        },
        //获取列表
        getAllList() {
            this.totalCount = '';
            let parmas = {
                deptId: this.porjectType,
                state: this.state,
                pageNum: this.pageNum,
                pageSize: this.pageSize,
                ruleType: this.fseRuleType,
                startDate: this.startTime ? initYMD(this.startTime) :'',
                endDate: this.endTime ? initYMD(this.endTime) :'',
                type:this.recordType
            };
            getFseRecordList(parmas)
                .then(res => {
                    if (res.code == 200) {
                        this.list = res.data.list;
                        this.totalCount = res.data.total;
                    } else {
                        this.$Message.warning(res.msg);
                    }
                })
                .catch(error => {
                    console.log(error);
                });
        },
        getStartTime(index) {
            this.startTime = index;
        },
        getEndTime(index) {
            this.endTime = index;
        },
        searchAll() {
            if (this.endTime != "" && this.startTime != "") {
                if (new Date(this.startTime).getTime() > new Date(this.endTime).getTime()) {
                    this.$Modal.warning({
                        title: "提示",
                        content: "结束时间不能在开始时间之前"
                    });
                    return;
                }
            }
            this.getAllList();
            this.initData();
        },
        clear() {
            this.fseRuleType = "";
            this.pageNum = 1;
            this.current = 1;
            this.startTime = "";
            this.endTime = "";
            this.getAllList();
            this.initData();
        },
        gethandle() {
            this.flag = true;
            this.list = [];
            this.state = 0;
            this.pageNum = 1;
            this.current = 1;
            this.getAllList();
        },
        getYhandle() {
            this.flag = false;
            this.list = [];
            this.state = 1;
            this.pageNum = 1;
            this.current = 1;
            this.getAllList();
        },
        pageChange(index) {
            this.pageNum = index;
            this.getAllList();
        },
        getHandleDetails(row) {
            this.warnId = row.id;
            this.getDetails(row.id);
        },
        handle(index, rows) {
            this.warnId = rows[index].id;
            this.getDetails(rows[index].id);
        },
        getDetails(id) {
            let parmas = {
                id: id
            };
            getFseRecordDetails(parmas)
                .then(res => {
                    if (res.code == 200) {
                        if (res.data.handleState == 1) {
                            this.handleRemark = res.data.handleRemark;
                            this.handleResult = res.data.handleResult;
                            this.isAdd = false;
                        } else if (res.data.handleState == 0) {
                            this.handleRemark = "";
                            this.handleResult = "";
                            this.isAdd = true;
                        }
                        this.handleModal = true;
                        this.type = res.data.type;
                        this.modelName = res.data.modelName;
                        this.code = res.data.code;
                        this.operatorList = res.data.operatorList;
                        this.ruleType = res.data.ruleType;
                        this.ruleMaxValue = res.data.ruleMaxValue;
                        this.ruleMinValue = res.data.ruleMinValue;
                        this.triggerTime = res.data.triggerTime;
                        this.triggerValue = res.data.triggerValue;
                        this.handleTime = res.data.handleTime;
                        this.handleUserName = res.data.handleUserName;
                    } else {
                        this.$Message.warning(res.msg);
                    }
                })
                .catch(error => {
                    console.log(error);
                });
        },
        ok(type) {
            if (type == 0) {
                if (this.handleRemark == "") {
                    this.$Modal.warning({
                        title: "您有必填字段",
                        content: "请填写报警原因"
                    });
                    return;
                }
                if (this.handleResult == "") {
                    this.$Modal.warning({
                        title: "您有必填字段",
                        content: "请填写处理结果"
                    });
                    return;
                }
                this.handleFlag = false;
            } else if (type == 1) {
                if (this.allhandleRemark == "") {
                    this.$Modal.warning({
                        title: "您有必填字段",
                        content: "请填写报警原因"
                    });
                    return;
                }
                if (this.allhandleResult == "") {
                    this.$Modal.warning({
                        title: "您有必填字段",
                        content: "请填写处理结果"
                    });
                    return;
                }
                this.handleFlag = true;
            }
            this.Modal = true;
        },
        submit() {
            if(!this.handleFlag) {
                let parmas = {
                    warnId: this.warnId,
                    handleResult: this.handleResult,
                    handleRemark: this.handleRemark
                };
                getFseRecordHandle(parmas)
                    .then(res => {
                        if (res.code == 200) {
                            this.$Message.success("操作成功");
                            this.pageNum = 1;
                            this.current = 1;
                            this.getAllList();
                            this.initData();
                            this.handleModal = false;
                            this.Modal = false;
                        } else {
                            this.$Message.warning(res.msg);
                        }
                    })
                    .catch(error => {
                        console.log(error);
                    });
            } else {
                let parmas = {
                    warnIdList: this.warnIdList,
                    handleResult: this.allhandleResult,
                    handleRemark: this.allhandleRemark
                };
                getFseRecordBatchHandle(parmas)
                    .then(res => {
                        if (res.code == 200) {
                            this.$Message.success("操作成功");
                            this.pageNum = 1;
                            this.current = 1;
                            this.getAllList();
                            this.initData();
                            this.allhandleModal = false;
                            this.Modal = false;
                        } else {
                            this.$Message.warning(res.msg);
                        }
                    })
                    .catch(error => {
                        console.log(error);
                    });
            }

        },
        cancel(type) {
            if (type == 0) {
                this.handleModal = false;
            } else if (type == 1) {
                this.Modal = false;
            } else if (type == 3) {
                this.allhandleModal = false;
            }
        },
        handleSelectionChange(val){
            this.warnIdList =[];
            val.forEach(i=>{
                this.warnIdList.push(i.id)
            })
        },
        allhandle(){
            this.allhandleResult = "",
            this.allhandleRemark = "";
            this.allhandleModal = true;
        }
    }
};
</script>

<style scoped lang="less">
@import "./../../assets/style/slider.less";
@import "./../../assets/style/warn.less";
@import "./../../assets/style/themeBase.less";
.active {
    background: var(--themeColor) !important;
    border: var(--themeColor) !important;
    color: #fff !important;
}
/deep/.el-table__row{
    background-color: #F1F4F7 ;
}
/deep/.el-table--striped .el-table__body tr.el-table__row--striped td{
    background-color: #FDFDFD ;
}
</style>
